#ifndef NANE_INPUTSYSTEMIMPL__H
#   define  NANE_INPUTSYSTEMIMPL__H

#   include "nane/InputSystem/InputSystem.h"
#   include "nane/InputSystem/InputAction.h"
#   include "nane/core/crt/ModuleManager.h"

namespace nane
{
    class InputSystem::Implementation
    {
    public:
        Implementation();
        ~Implementation();

        void LoadModule( const ModulePtr& _module );
        void AddActionBinding( const char* _action, const InputBinding& _inputBinding, uint32 _modifiersCount, const InputBindingModifier* _modifiers );
        
    public:
        struct FindDevice
        {
            const InputDeviceSystem* inputDeviceSystem;
            FindDevice( const InputDeviceSystem* _inputDeviceSystem )
                : inputDeviceSystem(_inputDeviceSystem)
            {
                
            }
            
            bool operator()( const InputDeviceSystem* _inputDeviceSystem )
            {
                return inputDeviceSystem == _inputDeviceSystem;
            }
        };
        
        struct FindAction
        {
            const char* action;
            FindAction( const char* _action )
                : action( _action )
            {
            }
            
            bool operator()( const std::pair<std::string, InputAction>& _value )
            {
                return strcmp(action, _value.first.c_str()) == 0;
            }
        };
        
    public:
        IWindow::OSHandle windowHandle;
        typedef std::vector<InputDeviceSystem*> TInputDeviceSystemVector;
        TInputDeviceSystemVector inputDevices;
        TInputDeviceSystemVector inputDevicesWithContext;
        
        typedef std::vector< std::pair<std::string, InputAction> > TInputActionVector;
        TInputActionVector inputActions;
    };
}

#endif	// NANE_INPUTSYSTEMIMPL__H
